export const mockData: any[] = [
  {
    pkId: '1639070099683115009',
    projectName: '南通飞越百度',
    serialNumber: 'SDNTFYBD00001',
    projectStatus: 'NOT_STARTED',
    province: '江苏省',
    city: '南通市',
    area: '通州区',
    projectLocation: '南通飞越百度',
    detailAddress: '江苏省南通市通州区南通飞越百度',
    longitude: 121.075087,
    latitude: 32.064161,
    alarmCount: 0,
  },
  {
    pkId: '1639071401578299393',
    projectName: '南通公园南',
    serialNumber: 'SDNTGYN00001',
    projectStatus: 'NOT_STARTED',
    province: '江苏省',
    city: '南通市',
    area: '通州区',
    projectLocation: '南通公园南',
    detailAddress: '江苏省南通市通州区南通公园南',
    longitude: 120.764101,
    latitude: 32.094946,
    alarmCount: 0,
  },
  {
    pkId: '1641037326399987713',
    projectName: '测试项目',
    serialNumber: 'SD111212',
    projectStatus: 'CONSTRUCTION',
    province: '北京市',
    city: '',
    area: '西城区',
    projectLocation: '金融街街道二龙路29号',
    detailAddress: '北京市西城区金融街街道二龙路29号',
    longitude: 116.366744,
    latitude: 39.909475,
    alarmCount: 0,
  },
];

/**
 * @Description 火星坐标系（GCJ-02）与百度坐标系（BD-09）的转换
 * @param lng
 * @param lat
 * @returns {{lng: number, lat: number}}
 */
export function gcj02tobd09(
  lng: number,
  lat: number,
): { lng: number; lat: number } {
  const x_PI = (3.14159265358979324 * 3000.0) / 180.0;
  lat = +lat;
  lng = +lng;
  const z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);
  const theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);
  const bd_lng = z * Math.cos(theta) + 0.0065;
  const bd_lat = z * Math.sin(theta) + 0.006;
  return {
    lng: bd_lng,
    lat: bd_lat,
  };
}
import chinaJson from './100000.json';
import guangdongJson from './440000.json';
export function getGeoData(address: string): Promise<any> {
  return new Promise(resolve => {
    if (address === '100000') {
      resolve(chinaJson);
    } else {
      resolve(guangdongJson);
    }
  });
}
export function nowSize(value: number, initwidth = 1920): number {
  const nowClientWidth = document.documentElement.clientWidth;
  return value * (nowClientWidth / initwidth);
}
type ThemeDataValue1 = {
  font: string;
  mainBg: string;
  border: string;
  fontInfo: string;
  pieBorder: string;
  mapBorderColor: string;
  mapAreaColor: string;
};
type ThemeDataValue2 = {
  primary: string;
  primary60: string;
  primary50: string;
  primary_fade_30: string;
};
type ThemeData = {
  tint: ThemeDataValue1;
  dark: ThemeDataValue1;
  purple: ThemeDataValue2;
  green: ThemeDataValue2;
  cyan: ThemeDataValue2;
  red: ThemeDataValue2;
  blue: ThemeDataValue2;
  orange: ThemeDataValue2;
  grey: ThemeDataValue2;
  volcanic: ThemeDataValue2;
  azure: ThemeDataValue2;
};
export const ThemeData: ThemeData = {
  tint: {
    font: '#333333',
    mainBg: '#ffffff',
    border: '#eeeeee',
    fontInfo: '#999999',
    pieBorder: '#ffffff',
    mapBorderColor: '#ffffff',
    mapAreaColor: '#efefef',
  },
  dark: {
    font: '#ffffff',
    mainBg: '#444444',
    border: '#3f3f3f',
    fontInfo: '#666666',
    pieBorder: '#353535',
    mapBorderColor: '#313131',
    mapAreaColor: '#444444',
  },
  purple: {
    primary: '#9743fe',
    primary60: '#c18efe',
    primary50: '#cba1ff',
    primary_fade_30: 'rgba(151, 67, 254, 0.3)',
  },
  green: {
    primary: '#41c400',
    primary60: '#8ddc66',
    primary50: '#a0e280',
    primary_fade_30: 'rgba(65, 196, 0, 0.3)',
  },
  cyan: {
    primary: '#00b3b3',
    primary60: '#66d1d1',
    primary50: '#80d9d9',
    primary_fade_30: 'rgba(0, 179, 179, 0.3)',
  },
  red: {
    primary: '#ff333d',
    primary60: '#ff858b',
    primary50: '#ff999e',
    primary_fade_30: 'rgba(255, 51, 61, 0.3)',
  },
  blue: {
    primary: '#4771ff',
    primary60: '#91aaff',
    primary50: '#a3b8ff',
    primary_fade_30: 'rgba(71, 113, 255, 0.3)',
  },
  orange: {
    primary: '#f99603',
    primary60: '#fbc068',
    primary50: '#fccb81',
    primary_fade_30: 'rgba(249, 150, 3, 0.3)',
  },
  grey: {
    primary: '#222222',
    primary60: '#7a7a7a',
    primary50: '#919191',
    primary_fade_30: 'rgba(136, 136, 136, 0.3)',
  },
  volcanic: {
    primary: '#fa541c',
    primary60: '#ff9c79',
    primary50: '#ffad90',
    primary_fade_30: 'rgba(250, 84, 28, 0.3)',
  },
  azure: {
    primary: '#04a9f3',
    primary60: '#68cbf8',
    primary50: '#82d4f9',
    primary_fade_30: 'rgba(4, 169, 243, 0.3)',
  },
};
